Opting out of `dragenter` and `dragover` events (html5)

Posted by aaaidan on Stack Overflow See other posts from Stack Overflow or by aaaidan
Published on 2012-10-15T20:59:12Z Indexed on 2012/10/15 23:02 UTC
Read the original article Hit count: 279

I have a collection of draggable "content" elements, and a root-level "feedback" UI element which is displayed above them to provide feedback during drag and drop.

The problem is, during the drag operation, hovering over the "feedback" element causes the dragenter and dragover events to be fired on that element, rather than the underlying content element. It effectively "blocks" the dragenter event from firing on the correct element.

Is there a way for an element to cancel, or "opt out" of a dragenter/dragover event? I could display the feedback element underneath the content, but I'd rather not do that.

jsFiddle: http://jsfiddle.net/jact8/1/

I'm using the HTML drag/drop api, not jQuery or anything like that.

© Stack Overflow or respective owner

Related posts about html5

Related posts about dom